/**
 * 
 */
package com.android.fxcontacts.ui;

import android.content.Context;
import android.view.Window;

/**
 * @author Administrator
 * 
 */
public class PolicyManager
{
	private static final String POLICY_IMPL_CLASS_NAME = "com.android.internal.policy.impl.Policy";

	private static final IPolicy sPolicy;

	static
	{
		// Pull in the actual implementation of the policy at run-time
		try
		{
			Class policyClass = Class.forName(POLICY_IMPL_CLASS_NAME);
			sPolicy = (IPolicy) policyClass.newInstance();
		} catch (ClassNotFoundException ex)
		{
			throw new RuntimeException(POLICY_IMPL_CLASS_NAME
					+ " could not be loaded", ex);
		} catch (InstantiationException ex)
		{
			throw new RuntimeException(POLICY_IMPL_CLASS_NAME
					+ " could not be instantiated", ex);
		} catch (IllegalAccessException ex)
		{
			throw new RuntimeException(POLICY_IMPL_CLASS_NAME
					+ " could not be instantiated", ex);
		}
	}

	// Cannot instantiate this class
	private PolicyManager()
	{
	}

	// The static methods to spawn new policy-specific objects
	public static Window makeNewWindow(Context context)
	{
		return sPolicy.makeNewWindow(context);
	}

}
